from time import time

files = ['m1_sorted.txt','m2_reverse.txt','m3_shuffle.txt']
for filename in files:

  file = open(filename)
  start = time()
  isSwapped = True
  z = []
  for i in file.readlines():
    z.append(int(i))
  file.close()
  k = len(z)
  i = 0
  while isSwapped:
    isSwapped = False
    for j in range(k-1):
      if z[j] >z[j+1]:
        z[j],z[j+1] = z[j+1],z[j]
        isSwapped = True
    k-= 1

  end = time()
  print((end - start)//1)
  print('m=str(index+1)+'_
        sorted',int(sortirovka(m_sorted)),'milliseconds')
